﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Quester.BL.Entities;
using Quester.BL.Repositories.Abstract;
using Quester.Web.ViewModels.QLister;

namespace Quester.Web.Controllers.Teacher
{
    public class TestEditorController : Controller
    {
        private ITestRepository testRepository;


        public TestEditorController(ITestRepository repository)
        {
            testRepository = repository;
        }

        public ActionResult TestList()
        {
            QLister lister = new QLister();
            lister.Items = new List<QListerItem>();
            foreach(TestEntity test in testRepository.Tests)
            {
                lister.Items.Add(new QListerItem() { Title = test.TestName});
            }

            return View(lister);
        }


    }
}
